package com.qf.controller;

import com.qf.entity.TbStudent;
import com.qf.entity.TbTeacher;
import com.qf.service.TbTeacherService;
import com.qf.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author 10202
 * @version V1.0
 * @Project management-system
 * @Package com.qf.controller
 * @Date 2023/5/21 10:35
 */
@RestController
@RequestMapping("teacher")
public class TeacherController {

    @Autowired
    private TbTeacherService tbTeacherService;

    @PostMapping("login")
    public Result login(@RequestBody TbTeacher teacher){

        return tbTeacherService.login(teacher.getJobnum(),teacher.getTpassword());
    }

    @PutMapping("/updatePassword")
    public  Result updatePassword(@RequestBody TbTeacher tbTeacher ){

        return tbTeacherService.updatePassword(tbTeacher);
    }

    @PostMapping("sendEmail")
    public Result sendEmail(){

        return Result.success("发送成功");
    }


}
